Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when ??? is used to implement erased definition #11740

Closed
wants to merge 1 commit into from

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@@ -69,6 +73,12 @@ class PruneErasedDefs extends MiniPhase with SymTransformer { thisTransform =>
else tree

private def trivialErasedTree(tree: Tree)(using Context): Tree =
tree match
case tree: ValOrDefDef if !tree.symbol.is(Inline) && !tree.symbol.is(Synthetic) =>
if tree.rhs.symbol == defn.Predef_undefined then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next step might be to do tree.rhs.symbol != defn.Compiletime_erasedValue.

@nicolasstucki nicolasstucki marked this pull request as ready for review March 15, 2021 14:12
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #11721 , it uses ??? for erased definitions. Is there a potential conflict?

@nicolasstucki
Copy link
Contributor Author

It is possible. Currently, it seems not non of the tests have fatal warning. It should be fine.

@liufengyun
Copy link
Contributor

It is possible. Currently, it seems not non of the tests have fatal warning. It should be fine.

In #11721 , it uses erased given T = ??? to desugar try/catch.

@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented Mar 16, 2021

That is not on the RHS of an erased definition. It will be fine.

@liufengyun
Copy link
Contributor

That is not on the RHS of an erased definition. It will be fine.

Could you elaborate? In erased given T = ???, it seems ??? is on the RHS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn on erased definitions with ??? Proposal: allow erased to be used in place of a definition
2 participants